package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.Collections;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IDiscussDao;
import com.financing.platform.dto.DiscussDTO;
import com.financing.platform.util.SqlName;


@Repository("discussDaoImpl")
public class DiscussDaoImpl extends BaseDaoImpl implements IDiscussDao {

	@SuppressWarnings("unchecked")
	public List<DiscussDTO> queryDiscussList(DiscussDTO discussDTO) {
		try {
		    return 	this.sqlMapClient.queryForList(SqlName.discussList, discussDTO);
		} catch (SQLException e) {
			log.error("Query discuss list error !", e);
			return Collections.emptyList();
		}
	}

	public int updateDiscussStatus(DiscussDTO discussDTO) throws SQLException {
		return this.sqlMapClient.update(SqlName.updateDiscuss, discussDTO);
	}

}
